﻿namespace GSC.WebControls
{
    using System;
    using System.Collections.Generic;
    using System.Web.UI.Design;
    using System.Web.UI.Design.WebControls;
    using System.ComponentModel;
    using System.Web.UI;
    using System.Web;
    using System.Web.UI.WebControls;
    using System.IO;
    using System.ComponentModel.Design;
    using System.Web.UI.HtmlControls;
    class BackgroundCenterRightControlDesigner : CompositeControlDesigner
    {
        private BackgroundCenterRightControl _CenterRight;
        /// <summary>
        /// </summary>
        /// <param name="Component"></param>
        public override void Initialize(IComponent Component)
        {
            base.Initialize(Component);
            this._CenterRight = (BackgroundCenterRightControl)Component;
        }
        /*
        /// <summary>
        /// </summary>
        /// <returns></returns>
        public override string GetDesignTimeHtml()
        {
            try
            {
                //
                this.CreateChildControls();
                StringWriter sw = new StringWriter();
                HtmlTextWriter hw = new HtmlTextWriter(sw);
                Panel panel = new Panel();
                panel.BackColor = _CenterRight.BackColor;
                panel.BorderColor = _CenterRight.BorderColor;
                panel.BorderStyle = _CenterRight.BorderStyle;
                panel.BorderWidth = _CenterRight.BorderWidth;
                panel.Width = _CenterRight.Width;
                panel.Height = _CenterRight.Height;
                panel.Style["table-layout"] = "fixed";
                panel.Style["overflow"] = "hidden";
                panel.Style["background-position"] = "right top";
                panel.Style["vertical-align"] = "middle";
                panel.Style["background-repeat"] = "repeat-y";
                panel.Style["padding-bottom"] = this._CenterRight.PaddingBottom.ToString();
                panel.Style["padding-left"] = this._CenterRight.PaddingLeft.ToString();
                panel.Style["padding-top"] = this._CenterRight.PaddingTop.ToString();
                panel.Style["padding-right"] = this._CenterRight.PaddingRight.ToString();
                if (string.IsNullOrEmpty(_CenterRight.BackImage))
                    panel.Style["background-image"] = "url(" + _CenterRight.ResolveClientUrl(_CenterRight.GetWebResourceUrl("bg.gif")) + ")";
                else
                    panel.Style["background-image"] = "url(" + _CenterRight.ResolveClientUrl(_CenterRight.BackImage) + ")";
                Panel controlContainer = new Panel();
                controlContainer.Style["text-align"] = "center";
                controlContainer.Style["vertical-align"] = "middle";
                controlContainer.Style["overflow"] = "hidden";
                controlContainer.Style["background-color"] = "#FFFFCC";
                controlContainer.Width = Unit.Pixel((int)(this._CenterRight.Width.Value - 4));// Unit.Pixel((int)(this._CenterRight.Width.Value - 4 - (this._CenterRight.Padding.IsEmpty ? 0 : (this._CenterRight.Padding.Value * 2))));
                controlContainer.Height = this._CenterRight.Height;// Unit.Pixel((int)(this._CenterRight.Height.Value - (this._CenterRight.Padding.IsEmpty ? 0 : (this._CenterRight.Padding.Value * 2))));
                panel.Controls.Add(controlContainer);
                controlContainer.Controls.Add(new LiteralControl("Ascx Container"));

                panel.RenderControl(hw);
                return sw.ToString();
            }
            catch (Exception ex)
            {
                return ex.ToString();
            }
        }
         */ 
    }
}